#include <bits/stdc++.h>

using namespace std;

class Solution
{
public:
    int totalNumbers(vector<int> &digits)
    {
        set<int> uniqueEvenNumbers;
        int n = digits.size();
        for (int i = 0; i < n; ++i)
        {
            for (int j = 0; j < n; ++j)
            {
                if (j == i)
                    continue;
                for (int k = 0; k < n; ++k)
                {
                    if (k == i || k == j || digits[k] & 1)
                        continue;
                    int num = digits[i] * 100 + digits[j] * 10 + digits[k];
                    if (num >= 100)
                        uniqueEvenNumbers.insert(num);
                }
            }
        }

        return uniqueEvenNumbers.size();
    }
};
